<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>农资与农产品全程供应链物流平台-司机信息</title>
<meta name="kewywords" content="农资与农产品全程供应链物流平台"/>
<meta name="description" content="农资与农产品全程供应链物流平台"/>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<link rel="icon" href="js/dialog/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/dialog/lhgdialog.js?skin=default"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#driverInfoTb tr:odd").addClass("odd");	
			$("#driverInfoTb tr:even").addClass("even");			
		});
		function editCheck(){
			var selected_value = [];    
			$("input[name='ids']:checked").each(function(){    
			 	selected_value.push($(this).val());    
			});    
			if(selected_value.length == 0) {
				$.dialog.alert("你还没有选择任何内容"); 
				return false;
			} else if(selected_value.length > 1){
				$.dialog.alert("一次只能修改一条记录！"); 
				return false;
			}
			var id = selected_value[0];
			$("#editDriverId").val(id);
			$("#editDriver").submit();
		}
		function deleteCheck(){
			var selected_value = [];    
			$("input[name='ids']:checked").each(function(){    
			 	selected_value.push($(this).val());    
			});    
			if(selected_value.length == 0) {
				$.dialog.alert("你还没有选择任何内容"); 
				return false;
			} 
			$.dialog.confirm("确定要删除吗？", 
		    	function(){			    	
					var id = selected_value;
					document.getElementById("deleteDriverIds").value=id;
					$("#deleteDriver").submit();
				}, function(){}
			);			
		}
		
	</script>
</head>
<body>
<%@include file="top.jsp" %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	    <td width="187" height="37" bgcolor="#e0e0e0" class="brt bbt">
	    	<div class="topleft fl">系统菜单栏</div>
	    </td>
	    <td bgcolor="#e7e7e7" class=" bbt">
		    <div class="topleft fl">您现在的位置：<a href="#">首页</a>&nbsp;>&nbsp;<span>客户信息</span>
		    </div>
	    </td>
	</tr>
	<tr>
		<td width="187" height="100%" valign="top" bgcolor="#FFFFFF" class="brt">
			<div class="left_bk"> 
				<div class="menu2">
					<%@include file="database_left.jsp" %>	        
				</div>
			</div>
		</td>
		<td align="left" valign="top" bgcolor="#FFFFFF">
			<div class="content">
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
			        <tr>
						<td height="38" style="background:url(images/zz_tit.jpg) left top repeat-x;">
							<div class="tt_back fl">司机信息列表</div>
							<div class="fr">
								<img src="images/tit_right.jpg" alt="" width="103" height="38" />
							</div>
						</td>
			        </tr>
			        <tr>
						<td class="borders btn">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
						 		<tr>
									<td height="41" bgcolor="#fffeee" style="border-bottom:#fee7bd solid 1px;">
										<form action="queryDriver" method="post">		
										    <table width="800" border="0" cellspacing="0" cellpadding="0" align="left">
											    <tr>
												    <td width="80" align="right">司机姓名：</td>
												    <td width="160"><input type="text" name="driver.driver" class="input_are w122" /></td>
												    <td width="80" align="right">身份证号：</td>
												    <td width="160"><input type="text" name="driver.idCardNo" class="input_are w122" /></td>
												    <td width="80" align="right">司机状态：</td>
												    <td width="160" class="whitetdstyle">
													    <select name="driver.state" class="input_are w87">
															<option value="">--请选择--</option>
															<option value="空闲">空闲</option>
															<option value="出车">出车</option>
														</select>
												    </td>
												    <td width="80" align="center">
												    	<input type="image" type="button" onclick="queryCheck()" src="images/cx.jpg" />
												    </td>
												</tr>
											</table>
										</form>
									</td>
					  			</tr>
					  			<tr>
						  			<td align="center">
										<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
											<tr align="left">
												<td height="42" colspan="2">
													<input type="button" id="addBt" style="cursor: pointer;" class="buttons2" value="新  增"
														onClick="location.href='addDriver'" />
													<input type="button" id="editBt" class="buttons2" style="cursor: pointer;" value="修  改"
														onClick="editCheck()" />
													<input type="button" class="buttons2" id="deleteBt" value="删  除" style="cursor: pointer;" 
														onclick="deleteCheck()" />
													<form id = "editDriver" action="editDriver" method="post">
														<input type="hidden" id="editDriverId" name = "editDriverId" value="0" />								
													</form>
													<form id="deleteDriver" action="deleteDriver" method="post">
														<input type="hidden" id="deleteDriverIds" name="deleteDriverIds" value=""/>
													</form>
												</td>
											</tr>
											<tr>
												<td colspan="2">
												<div style="height:300px">
													<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">
														<tr class="captit">
															<td width="5%" height="31" align="center" valign="middle"><input type="checkbox" class="checks" /></td>
												            <td width="10%" height="31" align="center" valign="middle">姓名</td>
												            <td width="5%" height="31" align="center" valign="middle">性别</td>
												            <td width="14%" height="31" align="center" valign="middle">身份证号码</td>
												            <td width="10%" height="31" align="center" valign="middle">电话</td>
												            <td width="17%" height="31" align="center" valign="middle">住址</td>
												            <td width="7%" height="31" align="center" valign="middle">驾照类型</td>
												            <td width="11%" height="31" align="center" valign="middle">有效起止日期</td>
												            <td width="7%" height="31" align="center" valign="middle">有效期限</td>
												            <td width="5%" height="31" align="center" valign="middle">状态</td>
												            <td width="9%" height="31" align="center" valign="middle">车辆编号</td>
														</tr>
														<s:iterator value="driverList" id="driver" >
														<tr height="26" bgcolor="#efefef">
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF"><input type="checkbox" name="ids" value="<s:property value="#driver.idCardNo"/>"></td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF"><s:property value="#driver.driver"/></td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            <s:set name="sex" value="#driver.sex"/>
															<s:if test="#sex == 0">男</s:if>
															<s:else>女</s:else>
												           </td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF"><s:property value="#driver.idCardNo"/></td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF"><s:property value="#driver.telephone"/></td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF"><s:property value="#driver.address"/></td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF"><s:property value="#driver.licenseType"/></td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												           	<s:date name="#driver.validFrom" format="yyyy-MM-dd" />
												           </td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF"><s:property value="#driver.validPeriod"/>年</td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" class="wordblue"><s:property value="#driver.state"/></td>
												           <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" ><s:property value="#driver.vehicleNo"/></td>
														</tr>
														</s:iterator>
											        </table>
											    </div>
										        </td>
											</tr>											
									    </table>
									</td>
								</tr>
							</table>
						</td>
		        	</tr>
		      </table>
			</div>
	    </td>
	</tr>
</table>
<div class="bottom">版权所有：安徽朗坤物联网</div>
</body>
</html>